<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <script src='jquery.min.js'></script>
  <script src='tinymce.min.js'></script>
  <style>
    html, body,form {
      margin: 0;
      height: 100%;
      overflow: hidden;
    }
  </style>
</head>

<body>
  <form method="post">
    <textarea id="mytextarea"></textarea>
  </form>
</body>
<script>
  /**
    * @date 2020/09/01
    * @author wolfMan
    * @description {初始化编辑器}
  */
  tinymce.init({
    selector: '#mytextarea',
    placeholder: '添加商品图文描述，使你的商品更诱人…',
    language:'zh_CN',
    branding: false, // 隐藏右下角技术支持
    height: '100%',
    mobile: {
      // menubar: false, // 菜单隐藏
      toolbar: false,
      // toolbar_location: 'bottom', // 工具栏在底部
      toolbar: 'bold italic | alignleft aligncenter alignright',
      statusbar: false, // 显示隐藏状态栏
      // contextmenu: "bold copy", // 上下文菜单
      quickbars_insert_toolbar: false
    }
  });
  /**
    * @date 2020/09/01
    * @author wolfMan
    * @description {图片上传后回显}
  */
  function showImage(list) {
    if (!list && !list.length) {
      return;
    };
    list.forEach(item => {
      tinymce.get('mytextarea').insertContent(`<img class="img" style="max-width:100%;" src="${item}" />`);
    });
  };
  /**
    * @date 2020/09/01
    * @author wolfMan
    * @description {获取编辑器内容后提交}
  */
  function editerSubmit() {
    var editContent = tinymce.get('mytextarea').getContent();
    return encodeURI(editContent);
  };
  /**
    * @date 2020/09/01
    * @author wolfMan
    * @description {编辑时，富文本框内容回显}
  */
  function editShow(data) {
    // base64编码解码(utf-8)
    var showHtml = decodeURIComponent(escape(window.atob(data)));
    tinymce.activeEditor.setContent(showHtml);
  };
  // editShow ();
</script>
</html>